﻿Imports amod2

Public Class Form1

    Private main As Main ' hlavna triada z ktorej sa volaju vsetky ostatne metody 


    Private Sub btn_testDatasetFrm_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btn_testDatasetFrm.Click
        'main.FrmDataset.ShowDialog()
    End Sub

    Private Sub btn_DBGenSettings_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btn_DBGenSettings.Click
        Dim DlgDBGen As New DlgDBGenerator()
        If (main.DBGeneratorSettings IsNot Nothing) Then    ' ak eksistuje uz nastavenie
            DlgDBGen.SetComponents(main.DBGeneratorSettings)
        End If
        DlgDBGen.giveData(main) ' prerobit na konstruktor 
        DlgDBGen.ShowDialog()


    End Sub

    Private Sub btn_DB_beg_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btn_DB_beg.Click
        ' main.generateDatabase()
    End Sub

    Private Sub btn_createDBonDisk_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btn_createDBonDisk.Click
        'main.createDatabaseOnDisk()
    End Sub

    Private Sub btn_createSolution_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
    End Sub
    ' pri generovani projektu sa spusti len telo tejto metody : konstruktor a metoda GenerateProject
    Private Sub btn_final_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btn_final.Click

        ' nacitanie Amod Soulution iba pre testovanie
        Dim lDsAmodSolution As New DsAmodSolution()
        lDsAmodSolution.ReadXml("E:\templateWorks\destination\projekt.aModProj", XmlReadMode.IgnoreSchema)


        'dan Me.main = New Main("Mod", "Projekt", "E:\templateWorks\Templates", Nothing, "E:\templateWorks\destination", "Projekt")
        Me.main = New Main("E:\templateWorks\Templates", Nothing, "E:\templateWorks\destination", "projekt")

        Me.main.GenerateProject(main.getModulesForGenerating(lDsAmodSolution))
    End Sub


    Private Sub btn_createOneFrmProject_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btn_createOneFrmProject.Click
        ' nacitanie Amod Soulution iba pre testovanie
        Dim lDsAmodSolution As New DsAmodSolution()
        lDsAmodSolution.ReadXml("E:\templateWorks\destination\projekt.aModProj", XmlReadMode.IgnoreSchema)
        Me.main = New Main("E:\templateWorks\Templates", Nothing, "E:\templateWorks\destination", "projekt")

        Me.main.GenerateOneFormProject("Modul", "firma")
    End Sub
End Class
